from celery_tasks.sms.yuntongxun.ccp_sms import CCP
from . import constants
from ..main import celery_app


@celery_app.task(name='send_sms_code')
def send_sms_code(mobile,sms_code):
    """

    :param mobile:手机号码
    :param sms_code: 短信验证码
    :return: 成功：０　ｏｒ　失败：－１
    """
    send_status = CCP().send_template_sms(mobile,[sms_code,constants.SMS_CODE_REDIS_EXPIRES // 60],constants.SEND_SMS_TEMPLATE_ID)
    return send_status